library(FAIRsimulator) set.seed(32423)
StudyObjIni <- createStudy( nCohorts = 1, recruitmentAges = list(c(6,7)*30), nSubjects = c(500), cohortStartTimes = c(6*30), newCohortLink = list(NULL), Recruitmentfunction=function(...) {return(5000)}, samplingDesign = list(seq(0,12,by=2)*30), studyStopTime = 18*30+1, latestTimeForNewBirthCohorts=6*30, treatments =list(c("SoC-1","TRT-1","TRT-2","TRT-3","TRT-4")), effSizes = list(c(0.05,0.1,0.15,0.20,0.25)), randomizationProbabilities = list(rep(0.20,5)), minAllocationProbabilities = list(c(0.2,rep(0,4))) )
The study is simulated with the AdaptiveStudy
function.
StudyObj <- AdaptiveStudy(StudyObjIni)
The simulated HAZ values can be inspected using the plotHAZ
function.
plotHAZ(StudyObj)
tmp <- getProbData(StudyObj,strProb = "UnWeightedUpdateProbabilities",cohortAgeNames="6-18 months") kable(tmp %>% select(TreatmentName,Prob))
iter <- 100 ncores <- 7 myMultStud <- runMultiSim(StudyObjIni,iter=iter,ncores=ncores)
probDf <- myMultStud[[2]] # The Randomization probabilities probDfUnweightedUpdate <- getMultiProbList(myMultStud[[1]],ncores=ncores,strProb="UnWeightedUpdateProbabilities")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.